package com.busionline.wotu.baselibrary.navigation.bottom.iterator;


import com.busionline.wotu.baselibrary.navigation.bottom.TabItemView;

import java.util.ArrayList;
import java.util.List;



/**
 *集合型迭代器
 *@author woochen123
 *@time 2017/11/22 15:00
 *@desc
 */

public class ListTabIterator<T extends TabItemView> implements ITabIterator {
    private List<T> mList;
    int index = 0;

    public ListTabIterator() {
        mList = new ArrayList<>();
    }

    @Override
    public TabItemView next() {
        return mList.get(index++);
    }

    @Override
    public boolean hasNext() {
        return index < mList.size();
    }

    public void addItem(T item) {
        mList.add(item);
    }
}
